package com.ls.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ls.domain.Answer;
import com.ls.domain.Report;
import com.ls.mapper.AnswerMapper;
import com.ls.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = RuntimeException.class)
public class AnswerServiceImpl extends ServiceImpl<AnswerMapper, Answer> implements AnswerService {
    @Autowired
    private AnswerMapper answerMapper;

    @Override
    public List<Report> selectReportBySid(Integer sid, int startIndex, int pageSize) {
        return answerMapper.selectReportBySid(sid,startIndex,pageSize);
    }

    @Override
    public int selectReportBySidCount(Integer sid) {
        return answerMapper.selectReportBySidCount(sid);
    }

    @Override
    public List<Report> selectReportBySidConditions(Integer sid, String reportName, int startIndex, int pageSize) {
        return answerMapper.selectReportBySidConditions(sid,reportName,startIndex,pageSize);
    }

    @Override
    public int selectReportBySidConditionsCount(Integer sid, String reportName) {
        return answerMapper.selectReportBySidConditionsCount(sid,reportName);
    }
}
